package com.jinzhi.jzweb.controller;

import com.jinzhi.jzweb.domain.JazQuestionDO;
import com.jinzhi.jzweb.domain.vo.JazUserOrderVO;
import com.jinzhi.jzweb.service.JazQuestionService;
import com.jinzhi.jzweb.service.JazUserOrderService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;

@Controller
@RequestMapping("/jzweb/question")
public class JazQuestionListController {
    @Autowired
    private JazQuestionService jazQuestionService;
    @GetMapping()
    @RequiresPermissions("jzweb:questionList:questionList")
    String JazGroupSpecs(){
        return "jzweb/question/index";
    }

    @GetMapping("/info/{type}/{id}")
    String JazGroupSpecsInfo(@PathVariable("id") Long id,@PathVariable("type") String type,Model model){
        JazQuestionDO JazQuestiondo = null;
        if(!type.equals("add")){
            JazQuestiondo=jazQuestionService.selectById(id);
        }
        model.addAttribute("id", id);
        model.addAttribute("myData", JazQuestiondo);
        model.addAttribute("type", type);
        return "jzweb/question/info";
    }
}




